package zunyi03;

import java.util.Scanner;

/**
 * 判断平年还是闰年
 */
public class Year {
    public int year;

    //判断是否是闰年的方法
    public void isyear(int year){
       if (year%4==0 && year%100!=0 || year%400==0){
           System.out.println(year+"年是闰年");
       }else {
           System.out.println(year+"年是平年");
       }
    }

    public static void main(String[] args) {
        Year year = new Year();
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入要判断的年份：");
        int inputYear = sc.nextInt();
        year.isyear(inputYear);
    }
}
